/**
 * 
 */
package com.alstudio.utils.android.net.uploader;

import com.alstudio.app.ALLocalEnv;
import com.alstudio.utils.android.net.http.UploadPhotoRequest;
import com.alstudio.utils.android.net.http.UploadPhotoRequest.Callback;
import com.alstudio.utils.android.net.http.http2.UploadMediaRequest;
import com.alstudio.utils.android.net.http.http2.UploadMediaRequest.MediaUploadCallback;

/**
 * @author alonso lee
 * 
 */
public class ALHttpUploadTaskManager {

	/**
	 * 请求上传头像
	 * 
	 * @param servletUrl
	 * @param token
	 * @param username
	 * @param filepath
	 * @param callback
	 */
	public static UploadPhotoRequest UploadPhotoRequest(String servletUrl, String filepath,
			Callback callback) {
		UploadPhotoRequest req = new UploadPhotoRequest(servletUrl, null, null,
				filepath);
		req.requestAsync(callback);
		return req;
	}

	/**
	 * 请求上传语音介绍
	 * 
	 * @param servletUrl
	 * @param token
	 * @param username
	 * @param filepath
	 * @param callback
	 */
	public static UploadMediaRequest UploadVoiceIntroRequest(String servletUrl,
			String filepath, MediaUploadCallback callback) {
		UploadMediaRequest req = new UploadMediaRequest(servletUrl, ALLocalEnv
				.getLocalEnv().getMyAccount().getUserName(), ALLocalEnv
				.getLocalEnv().getMyAccount().getToken(),
				UploadMediaRequest.FILE_TYPE_AUDIO, filepath);
		req.requestAsync(callback);
		return req;
	}

}
